package com.rmondjone.face.adapter

import android.content.res.Resources
import android.graphics.Bitmap
import android.graphics.Canvas
import android.graphics.drawable.BitmapDrawable
import android.graphics.drawable.Drawable
import android.text.Html
import android.util.Log
import android.widget.TextView
import com.bumptech.glide.Glide
import com.bumptech.glide.load.DataSource
import com.bumptech.glide.load.engine.GlideException
import com.bumptech.glide.request.RequestListener
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.rmondjone.androidcamerademo.MyApplication
import com.rmondjone.androidcamerademo.MyImageGetter
import com.rmondjone.androidcamerademo.R
import com.rmondjone.androidcamerademo.bean.SuggestBean
import com.rmondjone.utils.dp
import com.zzhoujay.richtext.RichText


/**
 * copyright：
 * @author：anthui creation date： .
 * @since: 1.0.0
 * @describe:
 */
class SuggestAdapter : BaseQuickAdapter<SuggestBean, BaseViewHolder>(R.layout.item_suggest) {
    override fun convert(helper: BaseViewHolder, item: SuggestBean) {

        helper.setText(R.id.tv_title, item.title)
//        textView.setText(Html.fromHtml(html, MyImageGetter(), null))


        Log.e("msg", "------------- " + item.content)
        helper.getView<TextView>(R.id.tv_content).apply {
            RichText.from(item.content).into(this);


//            text = Html.fromHtml(item.content, MyImageGetter(this, mContext.resources), null)
        }
//        helper.setText(R.id.tv_content, item.content)


//        将艾帮主蕲艾敷贴贴在相应位置或使用艾帮主筋骨痛在相应穴位滑动
//        <span style='text-align:center;font-weight:bold'>足三里穴</span>
//        <img src="https://baikeimg.aibangzhu888.com/acupoint/1540864038497.jpg" width="80%">
//        <span style='text-align:center;font-weight:bold'>气海穴</span>
//        <img src="https://baikeimg.aibangzhu888.com/acupoint/1499844434553.jpg" width="80%">
//        <span style='text-align:center;font-weight:bold'>关元穴</span>
//        <img src="https://baikeimg.aibangzhu888.com/acupoint/1532922227393.jpg" width="80%">
//
        helper.setGone(R.id.view_line, helper.adapterPosition != data.size - 1)


    }

}
